home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / domacnost a kancelar / autoit / autoit-v3-setup.exe / Examples / Helpfile / _IEFormSubmit.au3 < prev    next >
Encoding:
Text File  |  2007-09-08  |  1.4 KB  |  35 lines

  1. ; *******************************************************
  2. ; Example 1 - Open a browser with the form example, fill in a form field and submit the form
  3. ; *******************************************************
  4. ;
  5. #include <IE.au3>
  6. $oIE = _IE_Example ("form")
  7. $oForm = _IEFormGetObjByName ($oIE, "ExampleForm")
  8. $oText = _IEFormElementGetObjByName ($oForm, "textExample")
  9. _IEFormElementSetValue ($oText, "Hey! It works!")
  10. _IEFormSubmit ($oForm)
  11.  
  12. ; *******************************************************
  13. ; Example 2 - Get a reference to a specific form element and set its value.
  14. ;                In this case, submit a query to the Google search engine
  15. ; *******************************************************
  16. ;
  17. #include <IE.au3>
  18. $oIE = _IECreate ("http://www.google.com")
  19. $oForm = _IEFormGetObjByName ($oIE, "f")
  20. $oQuery = _IEFormElementGetObjByName ($oForm, "q")
  21. _IEFormElementSetValue ($oQuery, "AutoIt IE.au3")
  22. _IEFormSubmit ($oForm)
  23.  
  24. ; *******************************************************
  25. ; Example 3 - Get a reference to a specific form element and set its value.
  26. ;                Call _IELoadWait manually if the default _IELoadWait experiences trouble.
  27. ; *******************************************************
  28. ;
  29. #include <IE.au3>
  30. $oIE = _IECreate ("http://www.google.com")
  31. $oForm = _IEFormGetObjByName ($oIE, "f")
  32. $oQuery = _IEFormElementGetObjByName ($oForm, "q")
  33. _IEFormElementSetValue ($oQuery, "AutoIt IE.au3")
  34. _IEFormSubmit ($oForm, 0)
  35. _IELoadWait($oIE)